# Created with pycharm
# author:ju bai
# Date:2021/7/20
# Time:19:31
from selenium import webdriver
import time
# 系统工具包
import os
# 上传文件

driver = webdriver.Chrome()
# 本地HTML
url = "file:///"+os.path.abspath("D:/Python/selenium2html/upload.html")
driver.get(url)
driver.maximize_window()
time.sleep(3)

driver.find_element_by_name("file").send_keys("D:/Python/selenium2html/upload.html")
time.sleep(6)
driver.quit()